
dbmysql_o =  dbsqlca.o mysqldb.o  dbutil.o \


test_o = test.o

INSTALL_HEADER = dbsqlca.h 
INSTALL_APP = libuhp_mysql.so
INSTALL_BIN = test
all	: $(INSTALL_APP) $(INSTALL_BIN)	
	
libuhp_mysql.so : $(dbmysql_o)
	g++ -shared -o $@  $(dbmysql_o) -L$(HOME)/lib -luhp_util -L/usr/lib64/mysql -lmysqlclient

test	: $(test_o)
	g++ -o $@  $(test_o) -L. -L$(HOME)/lib -luhp_mysql -luhp_util -lssl -lpthread

.cpp.o	:
	g++ -g -fPIC -O2 -Wall  -Wno-write-strings -o $@ -c $< -I. -I/usr/include/mysql -I/usr/include -I$(HOME)/include/uhp
.c.o	:
	gcc -std=gnu99 -g -fPIC -O2 -Wall  -Wno-write-strings  -o $@ -c $< -I. -I/usr/include -I$(HOME)/include/uhp

prepro_all:

clean	:
	rm -f *.so *.o test

install :
	make
	mkdir -p  $(HOME)/lib
	mkdir -p  $(HOME)/include/uhp
	for i in $(INSTALL_APP);\
	do \
		echo "rm -f $$i";\
		rm -f $(HOME)/lib/$$i;\
		echo "cp -f $$i";\
		cp -f $$i $(HOME)/lib;\
	done
	for i in $(INSTALL_HEADER);\
	do \
		echo "cp -f $$i";\
		cp -f $$i $(HOME)/include/uhp;\
	done
